package demo_02;

/**
 * description: TestOverride <br>
 * date: 2022/1/30 9:50 下午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */
public class TestOverride {
    public static void main(String[] args) {
        Horse horse = new Horse();
        horse.run();
        Student student = horse.whoIsPsg();
        System.out.println(student.height);


    }
}

class Vehicle {
    public void run() {
        System.out.println("跑！");
    }

    public void stop() {
        System.out.println("停止！");
    }

    public Person whoIsPsg() {
        return new Person();
    }
}

class Horse extends Vehicle {
    public void run() {
        System.out.println("四体翻飞，得得得...");
    }

    public Student whoIsPsg() {
        return new Student();
    }
}
